//
//  UIView+Extension.m
//  weibo19-oc
//
//  Created by MF on 16/8/30.
//  Copyright © 2016年 MF. All rights reserved.
//

#import "UIView+Extension.h"

//IB_DESIGNABLE

@interface UIView ()
@property (nonatomic, assign)IBInspectable CGFloat  cornerRadius;
@property (nonatomic, assign)IBInspectable  CGFloat boardWidth;
@property (nonatomic, strong)IBInspectable UIColor *boardColor;
@end

@implementation UIView (Extension)

-(void)setCornerRadius:(CGFloat)cornerRadius {
    self.layer.cornerRadius = cornerRadius;
    self.layer.masksToBounds = cornerRadius > 0;
}

-(CGFloat)cornerRadius {
    return self.layer.cornerRadius;
}

-(void)setBoardWidth:(CGFloat)boardWidth {
    self.layer.borderWidth = boardWidth;
}

-(CGFloat)boardWidth {
    return self.layer.borderWidth;
}

-(void)setBoardColor:(UIColor *)boardColor {
    self.layer.borderColor = boardColor.CGColor;
}

-(UIColor *)boardColor {
    return self.layer.borderColor;
}
@end
